package com.naiterui.ehp.bs.b2c.cart.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author guoyongxiang
 * @date 2019-05-14 18:02
 * @since 1.0.0
 */
@Data
@Entity
@NoArgsConstructor
@Table(name = "p_cart_item")
public class CartItem implements Serializable {

    private static final long serialVersionUID = 7443072759664731645L;
    /**
     * cart itme id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;
    /**
     * 用户id
     */
    @Column(name = "user_id")
    private Long userId;
    /**
     * 商品ID
     */
    @Column(name = "product_id")
    private Long productId;
    /**
     * skuId
     */
    @Column(name = "sku_id")
    private Long skuId;
    /**
     * 商品数量
     */
    @Column(name = "quantity")
    private Integer quantity;
    /**
     * 处方ID(自选非处方为0)
     */
    @Column(name = "recom_id")
    private Long recomId;
    /**
     * 是否处方药
     */
    @Column(name = "rx")
    private Integer rx;
    /**
     * 勾选状态(0:未选中, 1:选中)
     */
    @Column(name = "selected")
    private Integer selected;
    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;
    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

}
